package com.ea.eadp.nexus.test.pageDefinition.newconsole;

import org.openqa.selenium.WebDriver;
import org.testng.Assert;

/**
 * Created with IntelliJ IDEA.
 * User: yjtao
 * Date: 1/8/15
 * Time: 2:27 PM
 * To change this template use File | Settings | File Templates.
 */
public class UpdateParentEmailPage extends ConsoleBasePage {
    public static final String continueBtn = "continueBtn";

    public UpdateParentEmailPage(WebDriver driver) {
        super(driver, UpdateParentEmailPage.class, continueBtn);
    }

    public void assertThisIsThePage() {
        Assert.assertEquals(this.getElementStringByXPath("//div[@id='panel-parent-email-update']/div[2]/div[1]/div/span"), "Update your Parent/Guardian Email");
    }

    public void enterNewEmailAddress(String newParentEmail) {
        this.sendInput("parentEmail", newParentEmail);
    }

    public void clickUpdateButton() {
        clickBlank("//div[@id='panel-parent-email-update']/div[2]/div[1]/div/span");
        sendControllerKey('A');
    }

    public void skipThisPage() {
        sendControllerKey('B');
    }

    public String getStatusMessage() {
        return this.getElementStringByXPath("//li[@id='updated-parent-email-container']/div/span[3]");
    }
}

